<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simImportShape</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simImportShape" id="simImportShape"></a>simImportShape / sim.importShape </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Imports a <a href="../shapes.htm">shape</a> from a file (first imports meshes, then groups/merges them into a shape). See also <a href="simImportMesh.htm">sim.importMesh</a>.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simImportShape(simInt fileformat,const simChar* pathAndFilename,simInt options,simFloat identicalVerticeTolerance,simFloat scalingFactor)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>fileformat</strong>: set to 0. Fileformat is automatically detected<br>
</div>
<div><strong>pathAndFilename</strong>: the location of the file to import.<br>
</div>
<div><strong>options</strong>: bit-coded:</div>
<div class=tab>bit0 set (1): keep identical vertices</div>
<div class=tab>bit1 set (2): reserced. keep at 0.</div>
<div class=tab>bit2 set (4): reserved. keep at 0.</div>
<div class=tab>bit3 set (8): do not preserve colors</div>
<div class=tab>bit4 set (16): tries to preserve textures.</div>
<div class=tab>bit5 set (32): realigns the shape's bounding box with the world.</div>
<div class=tab>bit7 set (128): ignore up-vector coded in fileformat.</div>
<div><strong>identicalVerticeTolerance</strong>: not used. Set to 0<br>
</div>
<div><strong>scalingFactor</strong>: the scaling factor to apply to the imported vertices<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>The handle of the imported shape, or -1 if the operation was not successful<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>int shapeHandle=sim.importShape(int fileformat,string pathAndFilename,int options,float identicalVerticeTolerance,float scalingFactor)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
